Do not allow an uninitialised VCPU to be brought up. Also
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 18 Nov 2005 18:25:17 +0000 (19:25 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 18 Nov 2005 18:25:17 +0000 (19:25 +0100)
check VCPUOP_up return code in the guest and BUG() on
failure.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c
xen/common/domain.c

index 66bb891ec6a7c236519fed306ec0cccd9a2b1cd5..db15eb3dfb5209b296d11df44a97d2ecea46d10c 100644 (file)
@@ -410,7 +410,8 @@ int __devinit __cpu_up(unsigned int cpu)
 
        xen_smp_intr_init(cpu);
        cpu_set(cpu, cpu_online_map);
-       HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
+       if (HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL) != 0)
+               BUG();
 
        return 0;
 }
index 7398d79808f890a2c718471aaa06eef0b1a67a2a..430c0b0a8cddb2cedbcc732843398fe07e667a69 100644 (file)
@@ -425,7 +425,9 @@ long do_vcpu_op(int cmd, int vcpuid, void *arg)
         break;
 
     case VCPUOP_up:
-        if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+        if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
+            rc = -EINVAL;
+        else if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
             vcpu_wake(v);
         break;